const init ={
    count :0
}

export default function countReducer(prevState=init,action){
    const {
        type,
        data
    }=action
    switch (type) {
        case "increment":
            return {...init,count:prevState.count+data}
        case "decrement":
            return {...init,count:prevState.count-data}
    }
    return prevState
}